package com.ocm.order.feign;

import com.ocm.order.service.IOrderService;
import lombok.AllArgsConstructor;
import com.ocm.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * @Author hqy
 * @Date 23/01/2022
 * @Description
 */
@RestController
@AllArgsConstructor
public class OrderClient implements IOrderClient{

	private final IOrderService orderService;


	@Override
	@GetMapping(API_PREFIX+"getStatus")
	public R<Integer> getStatusById(@NotNull Long orderId) {
		Integer statusById = orderService.getStatusById(orderId);
		return R.data(statusById==null?0:statusById) ;
	}
}
